import request from '@/utils/request'

// 查询个人用户列表
export function listPersonalUser(query) {
  return request({
    url: '/manage-api/member/user/page',
    method: 'get',
    params: query
  })
}

export function searchPersonalUser(query) {
    return request({
        url: '/admin-api/member/user/search',
        method: 'get',
        params: query
    })
}



// 查询个人用户详细
export function getPersonalUser(id) {
  return request({
    url: '/manage-api/member/user/get?id=' + id,
    method: 'get'
  })
}

// 新增个人用户
export function addPersonalUser(data) {
  return request({
    url: '/manage-api/member/user/create',
    method: 'post',
    data: data
  })
}

// 修改个人用户
export function updatePersonalUser(data) {
  return request({
    url: '/manage-api/member/user/update',
    method: 'put',
    data: data
  })
}

// 删除个人用户
export function delPersonalUser(id) {
  return request({
    url: '/business/personalUser/' + id,
    method: 'delete'
  })
}

// 用户密码重置
export function resetUserPwd(id, password) {
    const data = {
        id,
        password
    }
    return request({
        url: '/manage-api/member/user/update-password',
        method: 'put',
        data: data
    })
}
